package net.sinodata.smartframework.threadpool.processor;

import net.sinodata.smartframework.schedulejob.job.HelloJob;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Description: Test01线程池业务处理类
 * 
 * @author: yinliangyun
 * @date: 2021-5-19
 */
@Component
public class Test01Processor {
	
	private static final Logger logger = LoggerFactory.getLogger(Test01Processor.class);// 日志

	public void Test01() {
		logger.info("初始化Test01Processor");
	}

	/**
	 * 线程池业务处理方法
	 *
	 * @param threadPoolName
	 *            线程池名称
	 */
	public void processTask(String threadPoolName) throws JobExecutionException {

		long start = System.currentTimeMillis();
		// 开始时间
		try {
			Thread.sleep(2000);
			logger.info("sleep 2000 : {}", threadPoolName + start);
		} catch (InterruptedException e) {
			logger.error("InterruptedException", e);
		}
		logger.info("processTask execute start : {}", threadPoolName);

	}

}
